home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Essential Home & Business Collection
/
The Essential Home & Business Collection.iso
/
26
/
3
/
4
/
TTDIR1.ZIP
/
TTDIR105.DOC
< prev
next >
Wrap
Text File
|
1990-11-24
|
2KB
|
52 lines
PowerBasic Directory Function: Version 1.05 November 24, 1990
What is the program:
The files in this archive use the Directory function of PowerBasic
2.10. I have added a sub-routine to read a directory along with
additional information about each file in that directory.
How it works:
The heart of the program is the 'DIR$' function included in the
PowerBasic 2.10 package. I used this as the base for the GetDirectory
functions. When I ran a test call to get the 'DTA' after doing a
'DIR$' I found that the DTA area had all of the additional information
about the file. Using this fact I wrote a sub-routine to get a
complete directory.
The sub-routine in 'TTDIR100.BAS' is the first draft of this
sub-routine. All of the information about the directory is stored in a
string array.
The sub-routine in 'TTDIR101.BAS' is the second draft. I corrected a
problem in calculating the size of the file. Also, I found out that I
could place the call to get the 'DTA' outside of the loop reading the
directory.
The sub-routine in 'TTDIR105.BAS' is the latest draft. I placed all
text information into one string array. Also, I moved the file date
and time into a separate integer array and the file size into a third
separate array. I did this to see if using integer arrays were faster
than appending everything into a string array. There should be a
program called 'TTEST5.BAS' that will call all of the sub-routines to
show the difference in speed.
If you don't have PowerBasic you still can use these program. Just
replace the first call to 'DIR$' with the DOS 'FINDFIRST' function and
the second call to 'DIR$' with the DOS 'FINDNEXT' function.
The sub-routines themselves have comments on the parameters expected.
If you have any questions, comments, for suggestions on this subroutine
you can reach me on CompuServe. My ID is 72540,2315.
Thanks
Thomas Traynor
72540,2315